package net.homeip.jcperera.nu.config.component;

import javax.inject.Named;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import net.homeip.jcperera.nu.model.entity.PersistentEntity;

/**
 * Installable Component, referring to a component that is installed into the framework
 * 
 * @name Installable Component class
 * @author julio.c.perera@gmail.com
 * @application nu
 * @since 0.1.0.0
 */

@Named(Installable.componentName)
@Table(name = Installable.tableName)
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorValue(value = Installable.tableName)
public class Installable extends PersistentEntity
{
    // Required to implement Serializable interface
    private static final long  serialVersionUID = 1591062963468712399L;

    // CoreBase properties, for easy use from other components, as well as logging
    public static final int    runtimeLevel     = 1;
    public static final String moduleName       = "config";
    public static final String componentName    = "nu_config_component_installable";

    // All persistent entities should specify a table name
    public static final String tableName        = "INSTALLABLE";

    @Basic
    @Column(name = "NAME")
    private String             name;

    @Basic
    @Column(name = "DESCRIPTION", length = 1024)
    private String             description;

    @Basic
    @Column(name = "VERSION")
    private Double             version;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getDescription()
    {
        return description;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public Double getVersion()
    {
        return version;
    }

    public void setVersion(Double version)
    {
        this.version = version;
    }
}
